/*
 +----------------------------------------------------------------------
 + Title        : 足迹接口
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-08-10
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 足迹接口
 +----------------------------------------------------------------------
*/

import { http } from '@/utils/httpRequest'

/**
 * 足迹列表
 * 
 * 参数 params 包含以下数据
 * {
 *      goods_id, ------------------------------------------------非必传,商品ID
 *      page, ----------------------------------------------------非必传,页码
 *      page_size, -----------------------------------------------非必传,条数
 * }
 *
 * return json
 * author huwl
 */
export const reqUserFootprintListAPI = (data: any) => {
    return http({
        method: 'GET',
        url: 'userFootprint/list',
        data
    })
}

/**
 * 足迹数量
 * 
 * 参数 params 包含以下数据
 * {
 *      goods_id, ------------------------------------------------非必传,商品ID
 * }
 *
 * return json
 * author huwl
 */
export const reqUserFootprintTotalAPI = (data?: any) => {
    return http({
        method: 'GET',
        url: 'userFootprint/total',
        data
    })
}

/**
 * 新增足迹
 * 
 *  @param goods_id-----------------------------------------商品ID
 *
 * return json
 * author huwl
 */
export const reqAddUserFootprintAPI = (goods_id: any) => {
    return http({
        method: 'POST',
        url: 'userFootprint/add',
        data: { goods_id }
    })
}

/**
 * 删除足迹
 * 
 *  @param goods_id-----------------------------------------商品ID
 *
 * return json
 * author huwl
 */
export const reqDeleteUserFootprintAPI = (id: any) => {
    return http({
        method: 'POST',
        url: 'userFootprint/delete',
        data: { ids: id }
    })
}